fix: add error logging to silent catch blocks in selfPR.js#497
fix: add error logging to silent catch blocks in selfPR.js#497gugli4ifenix-design wants to merge 1 commit intoEvoMap:mainfrom
Conversation
Three empty catch blocks in selfPR.js silently swallowed errors that could cause PR creation to fail without any diagnostic output: - State file write failure: now logs warning when state can't be saved - Summary generation failure: now logs which method failed - Fallback summary failure: now logs fallback error Kept intentionally silent catches for: - Optional state file read (returns default on missing) - Individual file read in diff collection (skips file) - Temp directory cleanup (best-effort)
|
Thank you @gugli4ifenix-design — the insight about silent Shipped in v1.70.0-beta.4 (just published to npm on the
Not adopted (intentional, with reasoning):
The reason we cannot merge this PR directly is structural, not about the change itself: this repository is built from an internal maintainer branch and published here as a distribution artifact. External code PRs are not merged into the upstream; we instead port the intent manually, which is what happened here. You will be credited in the release notes for v1.70.0-beta.4. Separately — thank you for also filing #499. It is being handled on its own thread. Closing this PR as adopted-internally. |
Problem
Several
catch (_) {}blocks insrc/gep/selfPR.jssilently swallow errors that can cause PR creation to fail with no diagnostic output. WhenselfPRfails to write state or generate a summary, users see no indication of what went wrong.Changes
Added
console.warnlogging to 3 catch blocks where errors are genuinely hidden:catch (_) {}catch (e) { console.warn(...) }catch (_) {}catch (e) { console.warn(...) }catch (_) {}catch (e) { console.warn(...) }Kept 3 intentionally silent catches unchanged:
Context
Found via automated code scanning (132 empty catch blocks across the codebase). This PR addresses the highest-impact file first —
selfPR.jsis responsible for creating PRs, so silent failures here directly block the evolution loop.